package com.party.admin.web.dto.output.merchantAnalyze;

import com.party.core.model.member.MemberMerchantCount;
import com.party.core.model.member.MemberMerchantDetail;
import org.springframework.beans.BeanUtils;

/**
 * 数据分析输出视图
 * Created by wei.li.
 *
 * @date 2017/12/13 0013
 * @time 9:49
 */
public class MerchantAnalyzeOutput {

    //机构报名数
    private Integer applyNum;

    //机构订单数
    private Integer orderNum;

    //机构资金
    private Double money;

    //机构浏览量
    private Long viewNum;

    //机构会员数
    private Integer memberNum;

    //机构实名会员
    private Integer realMemberNum;

    // 成功数
    private Integer successNum;

    public Integer getApplyNum() {
        return applyNum;
    }

    public void setApplyNum(Integer applyNum) {
        this.applyNum = applyNum;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public Long getViewNum() {
        return viewNum;
    }

    public void setViewNum(Long viewNum) {
        this.viewNum = viewNum;
    }

    public Integer getMemberNum() {
        return memberNum;
    }

    public void setMemberNum(Integer memberNum) {
        this.memberNum = memberNum;
    }

    public Integer getRealMemberNum() {
        return realMemberNum;
    }

    public void setRealMemberNum(Integer realMemberNum) {
        this.realMemberNum = realMemberNum;
    }

    public Integer getSuccessNum() {
        return successNum;
    }

    public void setSuccessNum(Integer successNum) {
        this.successNum = successNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MerchantAnalyzeOutput that = (MerchantAnalyzeOutput) o;

        if (applyNum != null ? !applyNum.equals(that.applyNum) : that.applyNum != null) return false;
        if (orderNum != null ? !orderNum.equals(that.orderNum) : that.orderNum != null) return false;
        if (money != null ? !money.equals(that.money) : that.money != null) return false;
        if (viewNum != null ? !viewNum.equals(that.viewNum) : that.viewNum != null) return false;
        if (memberNum != null ? !memberNum.equals(that.memberNum) : that.memberNum != null) return false;
        return realMemberNum != null ? realMemberNum.equals(that.realMemberNum) : that.realMemberNum == null;

    }

    @Override
    public int hashCode() {
        int result = applyNum != null ? applyNum.hashCode() : 0;
        result = 31 * result + (orderNum != null ? orderNum.hashCode() : 0);
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (viewNum != null ? viewNum.hashCode() : 0);
        result = 31 * result + (memberNum != null ? memberNum.hashCode() : 0);
        result = 31 * result + (realMemberNum != null ? realMemberNum.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "MerchantAnalyzeOutput{" +
                "applyNum=" + applyNum +
                ", orderNum=" + orderNum +
                ", money=" + money +
                ", viewNum=" + viewNum +
                ", memberNum=" + memberNum +
                ", realMemberNum=" + realMemberNum +
                '}';
    }

    public static MerchantAnalyzeOutput transform(MemberMerchantCount memberMerchantCount){
        MerchantAnalyzeOutput merchantAnalyzeOutput = new MerchantAnalyzeOutput();
        BeanUtils.copyProperties(memberMerchantCount, merchantAnalyzeOutput);
        return merchantAnalyzeOutput;
    }


    public static MerchantAnalyzeOutput transform(MemberMerchantDetail memberMerchantDetail){
        MerchantAnalyzeOutput merchantAnalyzeOutput = new MerchantAnalyzeOutput();
        BeanUtils.copyProperties(memberMerchantDetail, merchantAnalyzeOutput);
        return merchantAnalyzeOutput;
    }
}
